/*
 * cgolay-internationalization.js v0.0.1
 * ================================================
 * Copyright 2012 Claybox Ltd
 * 
 * v0.0.1 is main to set the ajax error waring
 * is almost a library of the language dictionary
 * 
 **/
var dictionary = {
    English:{
        error_1: "Sorry our server encountered an unexpected error. Please try again.",
        error_2: "Sorry your request cannot be processed due to an unexpected error. Please try again.",
        error_3: "Please select your shipping address.",
        error_4: "Please enter a valid email address.",
        error_5: "The information you just entered is incomplete or incorrect. Please see the messages and make revisions/additions.",
        error_6: "Please select the items you would like to remove from My Favorites.",
        error_7: "Sorry the details of your order cannot be displayed due to an unexpected error. Please try again."
    } 
};

function getDictionaryEntity(language, id){
    for(var item in dictionary){
        if(item.toString() == language){
            for(var entity in dictionary[language]){
                if(entity.toString() == id){
                    return dictionary[language][entity];
                }
            }
        }
    }
    return null;
}

//alert(getDictionaryEntity("English","error_1"));

//var yesBtn = $('<a href="javascript:;" class="btn btn-yes">Yes</a>').appendTo(elBtns);
//if(this.settings.buttons.length > 1){
//    var noBtn = $('<a href="javascript:;" class="btn btn-no">No</a>').appendTo(elBtns);
//    if ($.isFunction(this.settings.buttons[0])){
//        var sureBtnCb = this.settings.buttons[0];
//        yesBtn.click(function(){
//            sureBtnCb.apply(self.elContext, arguments);
//        });
//    }
//    if($.isFunction(this.settings.buttons[1])){
//        var cancelBtnCb = this.settings.buttons[1];
//        noBtn.click(function(){
//            cancelBtnCb.apply(self.elContext, arguments);
//        });
//    }
//}else{
//    yesBtn.click(function(){
//        close();
//    });
//}